package freecomm.study.jumpactivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class NextActivity extends Activity
{
    private EditText tv1;
    private EditText tv2;
    private Button btn;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.next_activity);
        tv1 = (EditText) findViewById(R.id.editText1);
        tv2 = (EditText) findViewById(R.id.editText2);
        btn = (Button) findViewById(R.id.nextActivityBackButton);
        btn.setOnClickListener(new OnClickListener()
        {

            @Override
            public void onClick(View v)
            {
                // TODO Auto-generated method stub
                Intent intent1 = getIntent();
                Intent intent  = new Intent();
                Bundle b = new Bundle();
                b = intent1.getExtras();
                b.putString("a", b.getString("a")+b.getString("b"));
                b.putString("b", tv2.getText().toString());
                intent.putExtras(b);
                NextActivity.this.setResult(0,intent);
                NextActivity.this.finish();
            }
        });
    }
}
